package com.tdp.neo4j;

import java.util.Collection;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.GraphRepository;

public interface CooperationsRepository extends GraphRepository<Cooperations>{

	@Query("match (m:Authors)-[r:COOP]->(n:Authors) return r")
	Collection<Cooperations> getCooperations();
	
	@Query("match (m:Authors)-[r:COOP]->(n:Authors) where id(r)={0} return r")
	Collection<Cooperations> findCooperationsbyID(Long id);
	
	@Query("match (n:Authors)-[r:COOP]->(m:Authors) return count(r)")
	int getNumOfCooperations();
}
